{% extends "admin/base_site.html" %}
{% load i18n admin_modify %}

{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/forms.css{% endblock %}
{% block coltype %}colMS{% endblock %}
{% block bodyclass %}dashboard{% endblock %}
{% block userlinks %}<a href="/admin/doc/">{% trans 'Documentation' %}</a> / <a href="/admin/password_change/">{% trans 'Change password' %}</a> / <a href="/admin/logout/">{% trans 'Log out' %}</a>{% endblock %}
{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">
     <a href="/admin/">{% trans "Home" %}</a> &rsaquo;
     {% trans "Edit Settings" %}
</div>
{% endif %}{% endblock %}
{% block content %}
<div id="content-main">
{% if form.errors %}
    <p class="errornote">
    {% blocktrans count form.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
    </p>
{% endif %}
{% if form.fields %}
{% regroup form by module_name as modules %}
<form method="post">
	{% for module in modules %}
		<div class="module">
			<table summary="{% filter capfirst %}{% blocktrans with module.grouper as name %}Models available in the {{ name }} application.{% endblocktrans %}{% endfilter %}" width="100%">
			<caption>{% filter capfirst %}{% blocktrans with module.grouper as name %}{{ name }}{% endblocktrans %}{% endfilter %}</caption>
			{% regroup module.list by class_name as classes %}
			{% for class in classes %}
				{% if class.grouper %}
					<tr class="alt">
						<th>{% filter capfirst %}{% blocktrans with class.grouper as name %}{{ name }}{% endblocktrans %}{% endfilter %}</th>
						<th>&nbsp;</th>
					</tr>
				{% endif %}
				{% for field in class.list %}
					{% if field.errors %}
					<tr class="error">
						<td colspan="2">{{ field.errors }}</td>
					</tr>
					{% endif %}
					<tr{% if field.errors %} class="error"{% endif %}>
						<td>
							{{ field.label_tag }}
							{% if field.help_text %}
								<p class="help">{{ field.help_text|escape }}</p>
							{% endif %}
						</td>
						<td>{{ field }}</td>
					</tr>
				{% endfor %}
			{% endfor %}
			</table>
		</div>
	{% endfor %}
	{% for app in form.apps %}
		<h3>{{ app.app_label }}</h3>
		{% for field in app.fields %}
			<p>{{ field.label }}</p>
		{% endfor %}
	{% endfor %}
<input type="submit" value="Save" class="default" />
</form>
{% else %}
    <p>{% trans "You don't have permission to edit values." %}</p>
{% endif %}
</div>
{% endblock %}
